using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Coin : Prop
{
    protected override void Start()
    {
        LevelManager.instance.AddCoinNum();
    }

    protected override void Update()
    {
        base.Update();
        transform.Rotate(0, 360 * Time.deltaTime, 0);
    }


    private void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Player")
        {
            if(other.GetComponent<CanMovePlayer>().IsOverlap) return;
            LevelManager.instance.SubCoinNum();
            GameManager.instance?.PlayerGetScoreAudio();
            Destroy(gameObject);
        }
    }
}
